Skip to content

fix(html): skip HTML balance warnings when Handlebars is present#3098

Closed
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/suppress-html-warnings-handlebars-2941
Closed

fix(html): skip HTML balance warnings when Handlebars is present#3098
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/suppress-html-warnings-handlebars-2941

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Suppress unclosed/unexpected HTML tag warnings while parsing inline HTML that contains Handlebars syntax ({{...}}).
  • Handlebars helpers such as {{#include}} are expanded after the HTML tree is built; validating tag balance on the pre-expansion source produced false positives (e.g. <details> wrapping an include inside an admonition).

Fixes #2941.

Test plan

  • cargo test -p mdbook html_with_handlebars
  • Existing unclosed_html_tags test still passes (real unclosed tags still warn)

Made with Cursor

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 17, 2026
Handlebars helpers such as `{{#include}}` are expanded after the HTML
tree is built. Validating tag balance on the pre-expansion source caused
false positives for patterns like `<details>...{{#include ...}}</details>`
inside admonitions.

Fixes rust-lang#2941.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ehuss
Copy link
Copy Markdown
Contributor

ehuss commented May 19, 2026

@leno23 I see that you've opened a large number of PRs using an AI tool. Please do not do that. Per the contributing guide, we are unable to review these.

@ehuss ehuss closed this May 23, 2026
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings when using an include within an admonition

3 participants